using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Workspace
{
    /// <summary>
    /// <para>Create SQLite Database</para>
    /// <para>Creates a GeoPackage or an SQLite database that contains the ST_Geometry or SpatiaLite spatial type.</para>
    /// <para>创建包含 ST_Geometry 或 SpatiaLite 空间类型的 GeoPackage 或 SQLite 数据库。</para>
    /// </summary>    
    [DisplayName("Create SQLite Database")]
    public class CreateSQLiteDatabase : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CreateSQLiteDatabase()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_out_database_name">
        /// <para>Output Database Name</para>
        /// <para>The location of the SQLite database or GeoPackage to be created and the name of the file. The .sqlite extension will be automatically assigned if the Spatial Type parameter value is ST_Geometry or SpatiaLite. If the Spatial Type parameter value is GeoPackage or any of the GeoPackage versions, the .gpkg extension will be automatically assigned.</para>
        /// <para>要创建的 SQLite 数据库或 GeoPackage 的位置以及文件的名称。如果空间类型参数值为 ST_Geometry 或 SpatiaLite，则将自动分配 .sqlite 扩展名。如果空间类型参数值为 GeoPackage 或任何 GeoPackage 版本，则将自动分配 .gpkg 扩展名。</para>
        /// </param>
        public CreateSQLiteDatabase(object _out_database_name)
        {
            this._out_database_name = _out_database_name;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Create SQLite Database";

        public override string CallName => "management.CreateSQLiteDatabase";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_out_database_name, _spatial_type.GetGPValue()];

        /// <summary>
        /// <para>Output Database Name</para>
        /// <para>The location of the SQLite database or GeoPackage to be created and the name of the file. The .sqlite extension will be automatically assigned if the Spatial Type parameter value is ST_Geometry or SpatiaLite. If the Spatial Type parameter value is GeoPackage or any of the GeoPackage versions, the .gpkg extension will be automatically assigned.</para>
        /// <para>要创建的 SQLite 数据库或 GeoPackage 的位置以及文件的名称。如果空间类型参数值为 ST_Geometry 或 SpatiaLite，则将自动分配 .sqlite 扩展名。如果空间类型参数值为 GeoPackage 或任何 GeoPackage 版本，则将自动分配 .gpkg 扩展名。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Database Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_database_name { get; set; }


        /// <summary>
        /// <para>Spatial Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the spatial type that will be installed with the new SQLite database or the GeoPackage version that will be created.</para>
        ///   <bulletList>
        ///     <bullet_item>ST_Geometry—The Esri spatial storage type will be installed. This is the default.</bullet_item><para/>
        ///     <bullet_item>SpatiaLite—SpatiaLite spatial storage type will be installed.</bullet_item><para/>
        ///     <bullet_item>GeoPackage (equivalent to GeoPackage 1.3)—An OGC GeoPackage 1.3 dataset is created.</bullet_item><para/>
        ///     <bullet_item>GeoPackage 1.0—An OGC GeoPackage 1.0 dataset will be created.</bullet_item><para/>
        ///     <bullet_item>GeoPackage 1.1—An OGC GeoPackage 1.1 dataset will be created.</bullet_item><para/>
        ///     <bullet_item>GeoPackage 1.2.1—An OGC GeoPackage 1.2.1 dataset will be created.</bullet_item><para/>
        ///     <bullet_item>GeoPackage 1.3—An OGC GeoPackage 1.3 dataset will be created.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将与新 SQLite 数据库或将要创建的 GeoPackage 版本一起安装的空间类型。</para>
        ///   <bulletList>
        ///     <bullet_item>ST_Geometry—将安装 Esri 空间存储类型。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>SpatiaLite—将安装 SpatiaLite 空间存储类型。</bullet_item><para/>
        ///     <bullet_item>GeoPackage（等效于 GeoPackage 1.3）- 创建 OGC GeoPackage 1.3 数据集。</bullet_item><para/>
        ///     <bullet_item>GeoPackage 1.0—将创建 OGC GeoPackage 1.0 数据集。</bullet_item><para/>
        ///     <bullet_item>GeoPackage 1.1—将创建 OGC GeoPackage 1.1 数据集。</bullet_item><para/>
        ///     <bullet_item>GeoPackage 1.2.1—将创建 OGC GeoPackage 1.2.1 数据集。</bullet_item><para/>
        ///     <bullet_item>GeoPackage 1.3—将创建 OGC GeoPackage 1.3 数据集。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Spatial Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _spatial_type_value _spatial_type { get; set; } = _spatial_type_value._ST_GEOMETRY;

        public enum _spatial_type_value
        {
            /// <summary>
            /// <para>ST_Geometry</para>
            /// <para>ST_Geometry—The Esri spatial storage type will be installed. This is the default.</para>
            /// <para>ST_Geometry—将安装 Esri 空间存储类型。这是默认设置。</para>
            /// </summary>
            [Description("ST_Geometry")]
            [GPEnumValue("ST_GEOMETRY")]
            _ST_GEOMETRY,

            /// <summary>
            /// <para>SpatiaLite</para>
            /// <para>SpatiaLite—SpatiaLite spatial storage type will be installed.</para>
            /// <para>SpatiaLite—将安装 SpatiaLite 空间存储类型。</para>
            /// </summary>
            [Description("SpatiaLite")]
            [GPEnumValue("SPATIALITE")]
            _SPATIALITE,

            /// <summary>
            /// <para>GeoPackage (equivalent to GeoPackage 1.3)</para>
            /// <para>GeoPackage (equivalent to GeoPackage 1.3)—An OGC GeoPackage 1.3 dataset is created.</para>
            /// <para>GeoPackage（等效于 GeoPackage 1.3）- 创建 OGC GeoPackage 1.3 数据集。</para>
            /// </summary>
            [Description("GeoPackage (equivalent to GeoPackage 1.3)")]
            [GPEnumValue("GEOPACKAGE")]
            _GEOPACKAGE,

            /// <summary>
            /// <para>GeoPackage 1.0</para>
            /// <para>GeoPackage 1.0—An OGC GeoPackage 1.0 dataset will be created.</para>
            /// <para>GeoPackage 1.0—将创建 OGC GeoPackage 1.0 数据集。</para>
            /// </summary>
            [Description("GeoPackage 1.0")]
            [GPEnumValue("GEOPACKAGE_1.0")]
            value3,

            /// <summary>
            /// <para>GeoPackage 1.1</para>
            /// <para>GeoPackage 1.1—An OGC GeoPackage 1.1 dataset will be created.</para>
            /// <para>GeoPackage 1.1—将创建 OGC GeoPackage 1.1 数据集。</para>
            /// </summary>
            [Description("GeoPackage 1.1")]
            [GPEnumValue("GEOPACKAGE_1.1")]
            value4,

            /// <summary>
            /// <para>GeoPackage 1.2.1</para>
            /// <para>GeoPackage 1.2.1—An OGC GeoPackage 1.2.1 dataset will be created.</para>
            /// <para>GeoPackage 1.2.1—将创建 OGC GeoPackage 1.2.1 数据集。</para>
            /// </summary>
            [Description("GeoPackage 1.2.1")]
            [GPEnumValue("GEOPACKAGE_1.2")]
            value5,

            /// <summary>
            /// <para>GeoPackage 1.3</para>
            /// <para>GeoPackage 1.3—An OGC GeoPackage 1.3 dataset will be created.</para>
            /// <para>GeoPackage 1.3—将创建 OGC GeoPackage 1.3 数据集。</para>
            /// </summary>
            [Description("GeoPackage 1.3")]
            [GPEnumValue("GEOPACKAGE_1.3")]
            value6,

        }

        public CreateSQLiteDatabase SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}